﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="View.aspx.cs"
    Inherits="Wicresoft.RDW.LocationDocument.View" %>

<%@ Register Src="../UserControls/PagerControl.ascx" TagName="PagerBasicControl"
    TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script language="javascript" type="text/javascript">
    $(function () {
        $("#<%=btnQuery.ClientID %>").click(checkAllTextValid);
        $("#<%=btnAdd.ClientID %>").click(checkAllTextValid);
    });     
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="main_title">
        <h2>
            <%=Resources.ManageResource.LocationDocument_Manage%></h2>
    </div>
    <div class="line_gray">
    </div>
    <br />
    <div>
        <asp:Label ID="lblLocation" runat="server"></asp:Label>
        <asp:DropDownList ID="ddlLocation" runat="server" AutoPostBack="true">
        </asp:DropDownList>
        <asp:Label ID="lblNameCN" runat="server"></asp:Label>
        <asp:TextBox ID="txtNameCN" runat="server"></asp:TextBox>
        <asp:Label ID="lblNameEN" runat="server"></asp:Label>
        <asp:TextBox ID="txtNameEN" runat="server"></asp:TextBox>
    </div>
    <br />
    <div>
        <asp:Label ID="lblFromDate" runat="server"></asp:Label>
        <asp:TextBox ID="txtFromDate" runat="server"></asp:TextBox>
        <asp:RegularExpressionValidator ID="revtxtFromDate" runat="server" ErrorMessage="*"
            ForeColor="Red" Display="Dynamic" ControlToValidate="txtFromDate" ValidationExpression="20\d{2}-\d{2}-\d{2}"></asp:RegularExpressionValidator>
        <asp:Label ID="Label1" runat="server" Text="-"></asp:Label>
        <asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
        <asp:RegularExpressionValidator ID="revtxtToDate" runat="server" ErrorMessage="*"
            ForeColor="Red" Display="Dynamic" ControlToValidate="txtToDate" ValidationExpression="20\d{2}-\d{2}-\d{2}"></asp:RegularExpressionValidator>
        <asp:Button ID="btnQuery" runat="server" OnClick="btnQuery_Click" />
        <asp:Label ID="lblOverError" runat="server" ForeColor="Red"></asp:Label>
    </div>
    <br />
    <div>
        <div align="right">
            <asp:Button ID="btnAdd" runat="server" CausesValidation="False" OnClick="btnAdd_Click" />
        </div>
        <div class="HistoryApplicationContent">
            <asp:GridView ID="gvLocationDocument" runat="server" AutoGenerateColumns="false"
                Width="100%" DataKeyNames="LocationDocumentId" OnRowDataBound="gvLocationDocument_RowDataBound"
                OnRowUpdating="gvLocationDocument_RowUpdating" OnRowDeleting="gvLocationDocument_RowDeleting"
                HeaderStyle-CssClass="dcTableHeader" RowStyle-CssClass="dcTableAlternatingItem"
                AlternatingRowStyle-CssClass="dcTableItem">
                <Columns>
                    <asp:TemplateField ItemStyle-Width="5%">
                        <ItemTemplate>
                            <asp:Label ID="lblNum" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="15%">
                        <ItemTemplate>
                            <asp:Label ID="lblLocation" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Name_CN" ItemStyle-Width="15%" />
                    <asp:BoundField DataField="Name_EN" ItemStyle-Width="15%" />
                    <asp:TemplateField ItemStyle-Width="15%">
                        <ItemTemplate>
                            <asp:Label ID="lblCreateBy" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="LastModifyTime" SortExpression="LastModifyTime" DataFormatString="[{0:yyyy-MM-dd}]"
                        HtmlEncode="false" ItemStyle-Width="15%"></asp:BoundField>
                    <asp:TemplateField ItemStyle-Width="22%">
                        <ItemTemplate>
                            <asp:LinkButton class="CommandButton" ID="lbtnUpdate" runat="server" CausesValidation="False"
                                CommandName="Update"></asp:LinkButton>
                            <asp:LinkButton class="CommandButton" ID="lbtnDelete" runat="server" CausesValidation="False"
                                CommandName="Delete"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <table width="100%">
                        <tr class="dcTableHeader">
                            <th width="5%">
                                <%=Resources.NameResource.No%>
                            </th>
                            <th width="15%">
                                <%=Resources.ManageResource.LocationDocument_Location%>
                            </th>
                            <th width="15%">
                                <%=Resources.ManageResource.LocationDocument_NameCN%>
                            </th>
                            <th width="15%">
                                <%=Resources.ManageResource.LocationDocument_NameEN%>
                            </th>
                            <th width="15%">
                                <%=Resources.ManageResource.LocationDocument_CreateBy%>
                            </th>
                            <th width="15%">
                                <%=Resources.ManageResource.LocationDocument_LastModifyTime%>
                            </th>
                            <th width="22%">
                                <%=Resources.ManageResource.mgr_lblAction%>
                            </th>
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>
            <uc:PagerBasicControl ID="pager" runat="server" PageSize="5" />
        </div>
    </div>
    <script type="text/javascript">
        var txtSartDate = $("#<%=txtFromDate.ClientID %>");
        var txtEndDate = $("#<%=txtToDate.ClientID %>");
        $(function () {
            txtSartDate.datepicker({ dateFormat: 'yy-mm-dd' });
            txtEndDate.datepicker({ dateFormat: 'yy-mm-dd' });
        });
    </script>
</asp:Content>
